home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44d.zip / DSIZ@1.QM < prev    next >
Text File  |  1992-04-26  |  6KB  |  100 lines

  1. *                               dsiz@1.QM
  2. *                        Written By Tom Hogshead
  3. *                       [ See DSIZxx.QM For Use ]
  4. *                                4/26/92
  5.  
  6. *                             M A C R O
  7. * ----------------------------------------------------------------------
  8. * @(1) Directory Sizes Sorted by Size in Descending Order,
  9. *      RIGHT Justify Number of Files' Column
  10. * ----------------------------------------------------------------------
  11. * This macro lists all directories in a current or a specified drive,
  12. * sorted by directory size in descending order.  The number of files in
  13. * each directory is also shown.  The macro can be invoked only at the
  14. * command line, not while editing, by running the batch file dsiz1.bat
  15. * which must be in the path or current directory.
  16.  
  17. *             SYNTAX:   dsiz1 [drive:] <enter>
  18.  
  19. * After the directory list is saved as [drive:]\dsiz.lst and loaded for
  20. * viewing, the temporary file c:\dsiz.ls (no "t" extension) is deleted.
  21.  
  22. * Macro @1 differs from @2 in that it RIGHT justifies the number of
  23. * files' column.
  24.  
  25. * Output of dsiz1.bat on my G: drive with @1:                   Note
  26. * -------------------------------------------            RIGHT Justification
  27. * Volume [G:MINISCRB_2] created: 92-Jan-20 14:34:16;             vvv
  28. * Directory of [g:\qpro\]                     2,214,991 bytes in  54 files
  29. * Directory of [g:\nu\]                       1,882,085 bytes in  45 files
  30. * Directory of [g:\qe\]                       1,400,421 bytes in  81 files
  31. * Directory of [g:\pcplus\]                   1,319,337 bytes in 158 files
  32. * Directory of [g:\slmr\]                       301,762 bytes in  15 files
  33. *                           < Lines omitted >
  34. * Directory of [g:\dos\]                        166,684 bytes in  19 files
  35. * Directory of [g:\pckwik\]                     118,310 bytes in  13 files
  36. * Directory of [g:\]                              2,043 bytes in   1 file
  37. * Directory of [g:\ibm\]                              0 bytes in   1 file
  38. *  14,310,447 bytes in 1,368 files.   15,069,184 bytes allocated (5% slack).
  39.  
  40. *         Contents of dsiz1.bat using @1 in dsiz@1.qm are:
  41. * ┌───────────────────────────────────────────────────────────────────────┐
  42. * │:                            dsiz1.bat                         4/23/92 │
  43. * │:      To run this batch file anywhere, change "Edsiz@1.mac" to:       │
  44. * │:                       "E[d:\path\]dsiz@1.mac"                        │
  45. * │:      where [d:\path\] is [drive:\directory\] for dsiz@1.mac location.│
  46. * │: %1 = Drive with colon.  Uses current drive if %1 is not specified.   │
  47. * │:      Requires DX.EXE (Directory Extended) and Q.EXE in path.         │
  48. * │:      Change c:\ to desired dsiz.ls location, preferably a ram drive. │
  49. * │                                                                       │
  50. * │       @echo off                                                       │
  51. * │       cls                                                             │
  52. * │       DX.EXE %1\ //t/st:1/he:1/at:hsd-/ff/ca:l/out:c:\dsiz.ls         │
  53. * │       Q.EXE c:\dsiz.ls  /Edsiz@1.mac                                  │
  54. * └───────────────────────────────────────────────────────────────────────┘
  55.  
  56. @1              macrobegin setscreenoff savesettings setinsmode
  57.                 setwordwrapmode togglewordwrap cursordown
  58. * --------- Move Directory Size To Line With Directory Name ---------*
  59.     JOINLINE:   cursordown jfalse AT_EOF
  60.                 delline unmarkblock markcolumn endline
  61.                 delltword delltword delltword delltword markcolumn
  62.                 cursorup gotocolumn "50" return moveblock
  63. * ------------------- Delete Blank Lines After Move ------------------*
  64.                 cursordown delline delline
  65.     AT_EOF:     begline jtrue JOINLINE
  66. * ----------------- Mark Size Block For Descend Sort -----------------*
  67.                 begfile cursordown gotocolumn return markcolumn
  68. * ------------- Descend Sort By Size (From @4 in rfr009.qm) ----------*
  69.                 sort
  70.     AGAIN:      gotoblockend jfalse DELMARK delline
  71.                 gotoblockbeg unkill jump AGAIN
  72.     DELMARK:    markcolumn wordleft wordleft
  73.     TO_TOP:     pageup jtrue TO_TOP markcolumn
  74. * ----------- Change "file "  to  "file*" To Line Up Column ----------*
  75.                 findreplace "file" return "file*" return "LNW" return
  76. * ------ Make Column Block Of Widest Line (From  @7 mis003.qm) -------*
  77.                 editfile "nul" return copyblock
  78.                 unmarkblock markcolumn
  79.              1: endline cursorleft markcolumn cursordown jtrue 1
  80. * ---------- Right Justify Column Block (From @1 rfr004.qm) ----------*
  81.                 gotoblockend cursorleft addline #173 cursorup
  82.     LOOP:       unmarkblock markcolumn endline
  83.                 cut begline paste endline jtrue EMPTY gotoblockend
  84.     EMPTY:      cursorleft cursorup jtrue LOOP begfile cursorright
  85.                 markcolumn endfile cursorup
  86.                 copy quit pasteover
  87. * -------------------- Remove's "*" From "file*" ---------------------*
  88.                 findreplace "*" return " " return "LN" return
  89. * ------------------ Save File To Drive And Cleanup ------------------*
  90.                 begfile wordright markword copy * Copy drive letter
  91.                 writeblock
  92.                     paste ":\dsiz.lst" return   * Write file to [d:]\dsiz.lst
  93.                     "o"                         * In case [d:]\dsiz.lst exists
  94.                 editfile return                 * Load [d:]\dsiz.lst
  95.                 nextfile killfile quit          * Kill/quit c:\dsiz.ls
  96.                 restoresettings
  97. *
  98. * 185 bytes Sun  04-26-1992  14:43:30 (TH @1)
  99.  
  100.